package com.ebupt.migu.music.schedule;

import com.ebupt.migu.music.api.service.CMSNoticeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时回调CMS获取最新活动数据
 * Created by Intellij IDEA.
 * User:  liuyangyang@cd.ebupt.com
 * Date:  2019/10/21
 */
@Slf4j
@Component
@EnableScheduling
public class CMSNoticeTask {
    @Autowired
    private CMSNoticeService cmsNoticeService;

    @Scheduled(initialDelay = 1000 * 60, fixedRate = 1000 * 60)
    public void run() {
        cmsNoticeService.doService();
    }
}
